#include <REGX52.H>
#include"LCD1602.h"
#include"Mat.h"
unsigned char Result=0;
unsigned int PastWord=0;
unsigned char count=0;
void main()
{
	LCD_Init();
	LCD_ShowString(1,1,"PastWord");
	while(1)
	{
		Result=Mat();
		if(Result)
		{
			if(count<4)
			{
				if(Result<=10)
				{
					PastWord*=10;
					PastWord=PastWord+Result;
					count++;
					LCD_ShowNum(2,1,PastWord,4);
				}
			}
			if(11==Result)
			{
			if(PastWord==2345)
				{
					LCD_ShowString(1,14,"OK ");
				}
				else
				{
					LCD_ShowString(1,14,"ERR");
				}
			}
			if(12==Result)
			{
				PastWord=0;
				count=0;
				LCD_ShowNum(2,1,PastWord,4);
			}
		}
	}
}



